package com.ksm.zyz.common.config;

import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * Created by ailot on 2015/11/23.
 */
@EnableSwagger2
public class SwaggerConfig extends WebMvcConfigurerAdapter{
    @Bean
    public Docket customDocket(){
        return new Docket(DocumentationType.SWAGGER_2)
                .groupName("KSM")
                .apiInfo(apiInfo())
                .select().build();
    }

    private ApiInfo apiInfo() {
        return new ApiInfoBuilder()
                .title("Ksm API")
                .description("后台API")
                .termsOfServiceUrl("http://127.0.0.1:88/app")
                .contact("ksm")
                .license("Ksm License Version 1.0")
                .licenseUrl("")
                .version("1.0")
                .build();
    }

}
